#! /usr/bin/env python
# encoding: utf-8

def build(bld):
    obj = bld.new_task_gen('cxx', 'cshlib')
    obj.source="""
        Buffer.cpp
        Switch.cpp
        masterPE.cpp
        slavePE.cpp
        packetNoc.cpp
        tinyxml_libs/tinystr.cpp
        tinyxml_libs/tinyxml.cpp
        tinyxml_libs/tinyxmlerror.cpp
        tinyxml_libs/tinyxmlparser.cpp
    """
    obj.uselib = 'BOOST BOOST_PYTHON TLM SYSTEMC_H'
    obj.uselib_local = 'systemc utils'
    obj.includes = '.'
    obj.target = 'packetNoc_lib'

    obj = bld.new_task_gen('pypp')
    obj.source ='''
        packetNoc.hpp
    '''
    obj.target='packetNoc32';
    obj.uselib = 'BOOST BOOST_PYTHON TLM SYSTEMC_H'
    obj.uselib_local = 'systemc utils packetNoc_lib'
    obj.include = 'scwrapper tlmwrapper'
    obj.start_decls = 'packetNoc'
    obj.split = 4
    obj.custom_code = """
mb.global_ns.class_('packetNoc').include()
xmlcls = mb.global_ns.classes(lambda decl : decl.name.startswith('TiXml') )
xmlcls.exclude()
"""

    bld.add_subdirs('governor trafficGenerator dummyEnd')

